package com.fenxiangtech.mall.exception;

import com.fenxiangtech.mall.enums.ExceptionEnum;

/**
 * @author zhangjiashun
 */
public class BaseException extends RuntimeException {

    private int code;

    private int statusCode;

    public BaseException() {
        super();
    }

    public BaseException(String msg) {
        super(msg);
    }

    public BaseException(int code, int statusCode, String msg) {
        super(msg);
        this.code = code;
        this.statusCode = statusCode;
    }

    public BaseException(ExceptionEnum exceptionEnum) {
        super(exceptionEnum.getMsg());
        this.code = exceptionEnum.getCode();
        this.statusCode = exceptionEnum.getStatusCode();
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public int getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(int statusCode) {
        this.statusCode = statusCode;
    }
}
